package com.example.templateapp.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.example.templateapp.ui.login.LoginActivity
import com.xuexiang.xutil.tip.ToastUtils

class LogoutReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        ToastUtils.toast("LogoutReceiver.onReceive")
        val activityIntent = Intent(context, LoginActivity::class.java)
        activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
        context?.startActivity(activityIntent)
    }
}